package oop1.Task1;

public class Visitor {
    String name;
    int age;
    double price;

    public void personMoney() {
        if (age >= 65) {
            System.out.println(name + "的年龄为:" + age + ",门票免费\n");
        } else if (age > 18) {
            price = price;
            System.out.println(name + "的年龄为:" + age + ",门票价格为:" + price + "元\n");
        } else if (age > 10) {
            price *= 0.5;
            System.out.println(name + "的年龄为:" + age + ",门票价格为:" + price + "元\n");
        } else {
            System.out.println(name + "的年龄为:" + age + ",门票免费\n");
        }
    }


}
